import { GCellRenderer } from "../../../../../com/mui/controls/GCellRenderer";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { SPetInfo } from "../../../../../Message/Game/SPetInfo";
import { PetUtil } from "../info/PetUtil";
//class PetComboBoxItemCellRender
    
    export  class PetComboBoxItemCellRender extends GCellRenderer
    {
        constructor()
        {
            super();
            this.init();
            this.addEventListener(flash.events.MouseEvent.MOUSE_MOVE, this.onMouseMove);
            this.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onMouseOut);
            return;
        }

        public init(): void
        {
            this._across = GlobalClass.getBitmap(ImagesConst.PullDownAcross);
            this._across.visible = false;
            this.addChild(this._across);
            this._nameText = new GTextFiled();
            this._nameText.selectable = false;
            this._nameText.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this.addChild(this._nameText);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=arg1["value"] as SPetInfo;
            this._nameText.htmlText = PetUtil.getPetName(loc1);
            return;
        }

        /* internal  */onMouseMove(arg1: Object /* flash.events.MouseEvent */): void
        {
            this._across.visible = true;
            return;
        }

        /* internal  */onMouseOut(arg1: Object /* flash.events.MouseEvent */): void
        {
            this._across.visible = false;
            return;
        }

        /* internal */ /* var */_across: Object /* flash.display.Bitmap */;

        protected /* var */_nameText: GTextFiled;
    }
